import Scene from "../Scene";
import { TLayout, TButton, SceneState } from "../SceneControl";

const { ccclass, property } = cc._decorator;

@ccclass
export default class ShowTipScene extends Scene {

    @property(cc.Node)
    handleNode: cc.Node = null;

    @property(cc.Boolean)
    showFinger: boolean = false;

    protected onEnable(): void {
        super.onEnable();
        this.initScene()
    }

    public initScene() {
        let layout = new TLayout();

        if(!this.handleNode){
            this.handleNode = this.node;
        }
        let btn = new TButton(this.handleNode)

        layout.buttonList = [[btn]];
        if (!this.showFinger) {
            this.tscene.sceneState = SceneState.hideFinger;
        }
        this.tscene.addLayout(layout);
        this.tscene.onBack = this.handleNode;
        this.tscene.joinController();
    }
}
